package roma.home.page;

import java.io.IOException;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class R02DraggablePage extends AbstractPage {

	public R02DraggablePage(WebDriver driver) {
		super(driver);
	}
	
	@FindBy(id = "draggable") WebElement draggEl;
	@FindBy(id="ui-id-2") WebElement constrainTab;
	@FindBy(id="draggabl") WebElement onlyVertical;
	@FindBy(id="draggabl2") WebElement onlyHorizontal;
	@FindBy(id="draggabl3") WebElement onlyBox;
	@FindBy(id="draggabl5") WebElement onlyParrent;
	

	public void clickOnConstrainTab() {
		clickOn(constrainTab);
	}
	
	//negative tests
	public void draggHorVertEl() {
		draggingElement(onlyVertical, 256, 0);
	}
	
	public void draggVertHorEl() {
		draggingElement(onlyHorizontal, 0, 250);
	}
	
	public void draggOuterBox() {
		draggingElement(onlyBox, 250, 350);
	}
	
	public void draggOuterParrent() {
		draggingElement(onlyParrent, 250, 350);
	}
	
	//positive tests
	public void draggDefEl() {
		draggingElement(draggEl, 250, 300);
	}
	
	public void draggVertVertEl() {
		draggingElement(onlyVertical, 0, 250);
	}
	
	public void draggHorHortEl() {
		draggingElement(onlyHorizontal, 250, 0);
	}
	
	public void makeDefaultSS() throws IOException {
		makeScreenShot("DefaultTab");
	}
	
	public void makeConstrainSS() throws IOException {
		makeScreenShot("ConstrainTab");
	}
	
}
